
const { defineConfig } = require('vite');
// import { viteStaticCopy } from 'vite-plugin-static-copy'
const viteStaticCopy=require('vite-plugin-static-copy').viteStaticCopy
const path=require('path')
const { resolve } = require('path')
// console.log('viteStaticCopy--',viteStaticCopy===viteStaticCopy1.viteStaticCopy)
let port=82;
let result=defineConfig({
  
  server: {
    host:true,
    port:port,
    hmr:false,
    proxy: {
      // 我的傻瓜代理
      // "/iotapi": {
      //   "target": "http://jy-test.seciiuat.shanghai-electric.com",
      //   "changeOrigin": true,
      //   "pathRewrite": {
      //     "^/iotapi": "/iotapi"
      //   }
      // }
    },
  },
  plugins: [
    viteStaticCopy({
      targets: 'mfc-src jiyuan-scada-app-config.js'.split(' ').map(s=>({src:s,dest:''}))
    })
    
  ],
  build:{
    assetsDir:'mfc-assets',
    rollupOptions: {
      input: {
        main: resolve(__dirname, 'index.html')
      },
      output:{
        manualChunks: undefined,
        assetFileNames:'mfc-assets/[name].[ext]'
      }
    },
    // minify:false
  }
});


module.exports=result;
